// 导入：类型、接口、模块、组件、样式
import { Component } from "react";

class Son extends Component {
  state = {
    a: 1,
    b: 2,
  };

  c() {}

  render() {
    return (
      <fieldset>
        <legend>Son</legend>
      </fieldset>
    );
  }
}

interface Props {}
interface State {}
class Index extends Component<Props, State> {
  render() {
    return (
      <fieldset>
        <legend>25-父操作子</legend>

        <button
          onClick={() => {
            console.log("子的数据：", this.refs.son);
          }}
        >
          点击父不需要子传直接操作
        </button>

        <Son ref="son" />
      </fieldset>
    );
  }
}
export default Index;
